#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>


int main()
{
    struct flock fl = { F_RDLCK, SEEK_SET, 0, 0, 0};

    int fd;

    fd = open("/boot/alock", O_RDONLY);
    if( fd == -1 )
    {
	perror("open");
	exit(1);
    }
    

    if( fcntl(fd, F_SETLK, &fl) == -1 )
    {
	    perror("fcntl");
	    exit(1);
    }

    close(fd);
    return 0;
}
